/**
 * Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.youedata.exception;

import com.youedata.base.exception.ServiceExceptionEnum;

/**
 * @author hao.yan
 * @Description 所有业务异常的枚举
 * @date 2016年11月12日 下午5:04:51
 */
public enum BizExceptionEnum implements ServiceExceptionEnum {


    /**
     * 通用
     */
    DATA_NOT_EXIST(1000, "数据不存在"),
    ERROR_JSONEXCEPTION(1001, "数据格式非法"),
    AUTH_ERROR(1002, "只能操作自己的数据"),
    CHRACTER_ERROR(1003, "数据编码转换错误"),
    PARAM_ERROR(1004, "参数错误"),
    GENDER_ERROR(1005, "性别参数错误"),
    TO_CLASS_ERROR(1006, "到课状态参数错误"),
    FLAG_ERROR(1007, "状态参数错误"),

    /**
     * 其他
     */
    AUTH_REQUEST_ERROR(400, "账号密码错误"),
    NO_ACCESS(403, "没有访问权限"),
    INTERNAL_EXCEPTION(500, "系统内部异常"),

    /**
     * FASTDFS
     */
    FASTDFS_UPLOAD_ERROR(12001, "文件上传错误"),
    IMG_DATA_ERROR(12005, "图片信息不存在"),
    FILE_NOT_EXISTS(12006, "文件不存在"),

    /**
     * 部门
     */
    DEPT_EMPTY(60001, "尚未录入部门信息"),

    /**
     * 用户
     */
    USER_DECRYPT_FAILD(30001, "数据加密通讯失败"),
    USER_INVALID_PARAM(30002, "数据内容不正确"),
    USER_DATA_EXPIRE(30002, "数据已过期"),

    /**
     * 班级管理
     */
    CLASS_EMPTY(40001, "尚未录入班级信息"),
    CLASS_NO_NOT_EXIST(40002, "班级编号不匹配"),

    /**
     * 学员管理
     */
    STUDENT_SCHOOLFINISHED_ERROR(50001, "学历状态错误"),
    STUDENT_EXIST(50002, "该学员已存在"),
    STUDENT_NOT_EXIST(50003, "该学员不存在"),
    SOME_STUDENT_NOT_EXIST(50004, "部分学员不存在"),

    TEACHER_EXIST(51002, "该教师已存在"),
    TEACHER_NOT_EXIST(51003, "该教师不存在"),
    SOME_TEACHER_NOT_EXIST(51004, "部分教师不存在"),
    TEACHER_NO_CLASSES(51005,"教师尚未绑定班级"),
    TEACHER_USER_NO_REL(51006,"账户与教师尚未绑定"),
    TEACHER_MOBILE_NO_EXIST(51007, "该教师已存在"),
    TEACHER_NOT_MATCH_CLASS(51008, "教师与班级不匹配"),
    TEACHER_NOT_MATCH_CER(51009,"教师与证书不匹配"),

    /**
     * 证书管理
     */
    CER_NOT_EXIST(60001, "该证书不存在"),
    SOME_CER_NOT_EXIST(60002, "部分证书不存在"),
    CER_LEVEL_ERROR(60003, "证书等级错误"),

    /**
     * 证书考试管理
     */
    EXAM_NOT_EXIST(70001, "考试报名信息不存在"),
    EXAM_INFO_ERROR(70002, "考试报名信息错误"),

    /**
     * Excel解析
     */
    EXCEL_ERROR(12002, "文件异常"),
    EXCEL_DOWNLOAD_ERROR(12003, "文件下载失败"),
    EXCEL_DATA_ERROR(12004, "文件解析异常"),
    EXCEL_URL_ERROR(12005, "EXCEL地址错误"),
    EXCEL_IMPORT_NULL(12006, "EXCEL内容为空");

    BizExceptionEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    private Integer code;

    private String message;

    @Override
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
